<template>
  <div>
    <svg-icon
      icon-class="fullscreen"
      style="color: #fff; width: 20px; height: 20px"
      @click="changeScreen"
    />
  </div>
</template>

<script>
// 版本问题
import ScreenFull from 'screenfull/dist/screenfull'
export default {
  name: '',
  components: {},
  props: {},
  data() {
    return {

    }
  },

  computed: {},
  watch: {},
  created() { },
  mounted() { },
  methods: {
    changeScreen() {
      // document.documentElement.requestFullscreen() 原生插件
      // ScreenFull.isEnabled全屏插件是否可用
      if (!ScreenFull.isEnabled) {
        this.$message.warning('当前全屏组件不可用')
        return
      }
      // // 直接全屏
      ScreenFull.toggle() // 全屏的方法 既可以全屏也可以退出全屏
    }
  }
}
</script>
<style lang='css' scoped>
</style>